<?php

include("mysql_conn.php");

$username = mysql_real_escape_string($_POST["username"]);
$title = mysql_real_escape_string($_POST["title"]);
$currduedate = mysql_real_escape_string($_POST["currduedate"]);
$projectid = mysql_real_escape_string($_POST["projectid"]);
$state = mysql_real_escape_string($_POST["state"]);

$sql="update projects set username='$username', title='$title', currduedate=str_to_date('$currduedate','%m/%d/%Y'), state='$state' where projectid='$projectid'";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "<html><head><meta http-equiv='refresh' content='0;url=myprojects.php'><link rel='stylesheet' type='text/css' href='style.css'></head><body>
Project edited successfully.<p>
<a href='myprojects.php'>Return to My Projects</a>
</body></html>";

mysql_close($con)
?>

